/* Copyright (c) 2004-2024 Peigen.info. All rights reserved. */

package info.peigen.hotpot.business.router.core.repository.entity;

import com.gitee.peigenlpy.actable.annotation.Column;
import com.gitee.peigenlpy.actable.annotation.Index;
import com.gitee.peigenlpy.actable.annotation.Table;
import com.gitee.peigenlpy.actable.annotation.Unique;
import com.gitee.peigenlpy.actable.constants.MySqlCharsetConstant;
import com.gitee.peigenlpy.actable.constants.MySqlEngineConstant;
import com.gitee.peigenlpy.actable.constants.MySqlTypeConstant;
import info.peigen.hotpot.business.router.facade.enums.ChannelCode;
import info.peigen.hotpot.business.router.facade.enums.WithdrawStatus;
import info.peigen.hotpot.common.core.enums.Currency;
import info.peigen.hotpot.common.core.lang.money.Money;
import info.peigen.hotpot.component.data.repository.beetlsql.entity.AbstractCreateTimeEntity;
import lombok.*;
import lombok.experimental.Accessors;
import lombok.experimental.FieldDefaults;

import java.util.Date;

/**
 * <b>(RouterWithdrawEntity)</b>
 * 路由-提现表
 *
 * @author Peigen
 * @version 1.0.0
 * @since 2021/8/1
 */
@Builder
@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@FieldDefaults(level = AccessLevel.PRIVATE)
@Accessors(chain = true)
@Table(name = "router_withdraw", comment = "路由-提现表", charset = MySqlCharsetConstant.UTF8MB4, engine = MySqlEngineConstant.InnoDB)
@org.beetl.sql.annotation.entity.Table(name = "router_withdraw")
public class RouterWithdrawEntity extends AbstractCreateTimeEntity {
    @Column(name = "withdraw_id", type = MySqlTypeConstant.VARCHAR, length = 30, isNull = false, comment = "withdraw_id")
    @Unique(value = "withdrawId", columns = "withdraw_id")
    @org.beetl.sql.annotation.entity.Column("withdraw_id")
    String         withdrawId;
    @Column(name = "trade_id", type = MySqlTypeConstant.VARCHAR, length = 30, isNull = false, comment = "trade_id")
    @Index(value = "tradeId", columns = "trade_id")
    @org.beetl.sql.annotation.entity.Column("trade_id")
    String         tradeId;
    @Column(name = "batch_no", type = MySqlTypeConstant.VARCHAR, length = 30, isNull = false, comment = "batch_no")
    @Index(value = "batchNo", columns = "batch_no")
    @org.beetl.sql.annotation.entity.Column("batch_no")
    String         batchNo;
    @Column(name = "channel_uni_id", type = MySqlTypeConstant.VARCHAR, length = 50, comment = "渠道返回的唯一ID")
    @org.beetl.sql.annotation.entity.Column("channel_uni_id")
    @Index(value = "channelUniId", columns = "channel_uni_id")
    String         channelUniId;
    @Column(name = "status", type = MySqlTypeConstant.VARCHAR, length = 50, isNull = false, comment = "提现状态")
    @Index(value = "status", columns = "status")
    @org.beetl.sql.annotation.entity.Column("status")
    WithdrawStatus status;
    @Column(name = "withdraw_channel_code", type = MySqlTypeConstant.VARCHAR, length = 30, isNull = false, comment = "提现渠道编码")
    @Index(value = "withdrawChannelCode", columns = "withdraw_channel_code")
    @org.beetl.sql.annotation.entity.Column("withdraw_channel_code")
    ChannelCode    withdrawChannelCode;
    @Column(name = "total_amount", type = MySqlTypeConstant.VARCHAR, length = 65, isNull = false, comment = "提现金额")
    @org.beetl.sql.annotation.entity.Column("total_amount")
    Money          totalAmount;
    @Column(name = "success_amount", type = MySqlTypeConstant.VARCHAR, length = 65, isNull = false, defaultValue = "0.00", comment = "提现成功金额")
    @org.beetl.sql.annotation.entity.Column("success_amount")
    Money          successAmount;
    @Column(name = "currency", type = MySqlTypeConstant.VARCHAR, length = 3, isNull = false, comment = "提现币种")
    @org.beetl.sql.annotation.entity.Column("currency")
    Currency       currency;
    @Column(name = "total_count", type = MySqlTypeConstant.INT, isNull = false, defaultValue = "0", comment = "提现总笔数")
    @org.beetl.sql.annotation.entity.Column("total_count")
    Integer        totalCount;
    @Column(name = "success_count", type = MySqlTypeConstant.INT, isNull = false, defaultValue = "0", comment = "提现成功笔数")
    @org.beetl.sql.annotation.entity.Column("success_count")
    Integer        successCount;
    @Column(name = "fee", type = MySqlTypeConstant.JSON, length = 1000, comment = "收费情况,见:WithdrawFee")
    @org.beetl.sql.annotation.entity.Column("fee")
    String         fee;
    @Column(name = "settle_date", type = MySqlTypeConstant.DATETIME, comment = "结算日期,代发成功日期")
    @org.beetl.sql.annotation.entity.Column("settle_date")
    Date           settleDate;
    @Column(name = "details", type = MySqlTypeConstant.JSON, length = 4000, comment = "提现WithdrawDetail集合")
    @org.beetl.sql.annotation.entity.Column("details")
    String         details;
    @Column(name = "orders", type = MySqlTypeConstant.JSON, length = 4000, comment = "提现Order集合")
    @org.beetl.sql.annotation.entity.Column("orders")
    String         orders;
    @Column(name = "position_trans_log_id", type = MySqlTypeConstant.VARCHAR, length = 30, comment = "trans_log_id#position")
    @org.beetl.sql.annotation.entity.Column("position_trans_log_id")
    String         positionTransLogId;
    @Column(name = "withdraw_trans_log_ids", type = MySqlTypeConstant.VARCHAR, length = 3000, comment = "trans_log_id#withdraws")
    @org.beetl.sql.annotation.entity.Column("withdraw_trans_log_ids")
    String         withdrawTransLogIds;
}